#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
using namespace std;
#include"BinarySearchTree.h"


void Test1()
{
	BSTree<int> root;
	int arr[] = { 8,3,1,10,6,4,7,14,13,5,10,15,20,21,22,32,2 };
	for (auto& e : arr)
	{
		root.Insert(e);
	}
	root.InOrder();
	cout << endl;

	for (auto& e : arr)
	{
		root.Erase1(e);
		root.InOrder();
		cout << endl;
	}

	BSTree<int> root2;
	for (auto& e : arr)
	{
		root2.Insert(e);
	}
	root2.InOrder();
	cout << endl;

	for (auto& e : arr)
	{
		root2.Erase2(e);
		root2.InOrder();
		cout << endl;
	}
	cout << root2.FindR(1) << endl;
}

void Test2()
{
	BSTree<int> root;
	int arr[] = { 8,3,1,10,6,4,7,14,13,5,10,15,20,21,22,32,2 };
	for (auto& e : arr)
	{
		root.InsertR(e);
	}
	root.InOrder();
	cout << endl;

	cout << root.FindR(1) << endl;


	for (auto& e : arr)
	{
		root.EraseR(e);
		root.InOrder();
		cout << endl;
	}
	cout << root.FindR(1) << endl;
}
void Test3()
{
	BSTree<int> root;
	int arr[] = { 8,3,1,10,6,4,7,14,13,5 };
	for (auto& e : arr)
	{
		root.InsertR(e);
	}
	root.InOrder();
	cout << endl;
	
	BSTree<int> r1(root);

	r1.InOrder();
	cout << endl;
	BSTree<int> t2 = r1;
	t2.InOrder();


}

int main()
{
	Test3();
	return 0;
}